<?php

if (!class_exists('ConfigNotFoundException')) {

    final class ConfigNotFoundException extends Exception {

        public function __construct($key) {
            $this->message = 'Config ' . $key . ' not found';
        }

    }

}
echo 1;
final class Config {

    private static $config = array();

    final public static function get($key, $silentError = true) {
        if (isset(self::$config[$key])) {
            return self::$config[$key];
        } else {
            if ($silentError) {
                return NULL;
            } else {
                throw new ConfigNotFoundException($key);
            }
        }
    }

    final public static function set($key, $value) {
        self::$config[$key] = $value;
    }

}

?>
